#pragma once
#ifndef __MATH_DEF_H__
#define __MATH_DEF_H__

typedef struct
{
	float x, y;
} CPoint;

typedef struct _CRect
{
	float top, bottom, left, right;	
	
	_CRect(): left(0.0f), top(0.0f), right(0.0f), bottom(0.0f) {}
	_CRect(float _left, float _top, float _right, float _bottom)
		:left(_left), top(_top), right(_right), bottom(_bottom) {}

	void SetRect(float l, float t, float r, float b)
	{
		top = t; left = l; bottom = b; right = r;
	}

	// methods
	bool ContainPoint(float x, float y) 
	{
		return (
			x >= left && x <= right &&
			y >= top && y <= bottom);
	}

	bool ContainPoint(CPoint p) 
	{
		return ContainPoint(p.x, p.y);	
	}
} CRect;

#endif